package com.xjtu.platform.user.student.consultRecord.imply;

import com.xjtu.platform.common.Utils;
import com.xjtu.platform.common.page.QueryAction;
import com.xjtu.platform.user.student.consultRecord.StudentConsultRecordDto;
import com.xjtu.platform.user.student.consultRecord.StudentConsultRecordModel;
import com.xjtu.platform.user.student.consultRecord.StudentConsultRecordService;
import com.xjtu.platform.user.student.consultRecord.dao.StudentConsultRecordDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class StudentConsultRecordServiceImpl implements StudentConsultRecordService {

    @Resource
    private StudentConsultRecordDao studentConsultRecordDao;

    @Override
    public Map<String, Object> getConsultRecord(StudentConsultRecordDto studentConsultRecordDto) {
        
        return Utils.getPage(studentConsultRecordDto, new QueryAction<StudentConsultRecordModel>() {

            @Override
            public List<StudentConsultRecordModel> execute() {
                return studentConsultRecordDao.getRecordInfo(studentConsultRecordDto);
            }
        });
    }
}
